package com.my.controller;


import com.my.result.Result;
import com.my.service.AnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/announcement")
public class AnnouncementController{

    @Autowired
    AnnouncementService announcementService;

    @GetMapping("/list")
    public Result getAnnouncemnetById(){
        return Result.okResult(announcementService.getAnnouncemnetById());
    }

    @GetMapping("/updateState")
    public Result updateState(@RequestParam Long id,@RequestParam Long state){
        //System.out.println(id+"==================="+state+"++++++++++++++++++++++++++");
        return announcementService.updataState(id,state);
    }

}

